
<?php $this->load->module('index/index/head');?>
<?php $this->load->module('member/index/center_head');?>


<script type="text/javascript" >
    $(function(){
        $('#sendCode').click(function(){
            if($('#mobile').find('input').hasClass('valid')){
                var account = $('input[name="Form[mobile]"]').val();
            }
            if($('#email').find('input').hasClass('valid')){
                var account = $('input[name="Form[email]"]').val();
            }
            if(account!==undefined){
                var verifyUrl = '<?php echo site_url('member/index/send_register_code');?>' ;
                $.post(verifyUrl,{
                    account:account
                },function(data){
                    var json = eval("("+data+")");
                    if(json['status']=='1')
                    {
                        time();
                    }
                })
            }else{
                console.log(account);
            }
        });
    });
    var wait=60;
    function time() {
        var o = $('#sendCode');
        if (wait == 0) {
            o.removeAttr("disabled");
            o.val("免费获取验证码");
            wait = 60;
        } else {
            o.attr("disabled", true);
            o.val("重新发送(" + wait + ")");
            wait--;
            setTimeout(function() {
                    time()
                },
                1000)
        }
    }
</script>

<div class="container">
    <div class="row">
        <div class="col-md-12">
            <div class="breadcrumb-box">
                <span class="breadcrumb-new-style">您所在的位置：</span>
                <ol class="breadcrumb ol-bgc">
                    <li><a href="<?php echo site_url('member/index/center')?>">会员中心</a></li>
                    <li class="active">更改手机号码</li>
                </ol>
            </div>
        </div>
        <?php $this->load->module('member/index/center_left',$extra);?>

        <div class="col-md-9 member-center-box-margin">
            <div class="col-md-12 member-center-title-left-border bg-warning">
                <h4><strong>更改手机号码</strong></h4>
            </div>
            <div class="changepassword">
                <form method="post" class="formvalidate form-horizontal" action="<?php echo $form_url;?>">
                    <div class="persona-info-container">
                        <div class="form-group">
                            <label class="col-md-2 control-label">原手机号</label>
                            <div class="col-md-4 yuanshoujihao"><?php echo substr($mobile,0,3).'****'.substr($mobile, 8) ;?></div>
                        </div>
                        <div class="form-group" id="mobile">
                            <label class="col-md-2 control-label">新手机号</label>
                            <div class="col-md-6">
                                <input type="text" name="Form[mobile]" class="input rounded form-control changepassword-form-contro" validate="{required:true,isMobile:true,remote:'<?php echo $mobile_verify;?>'}" />
                            </div>
                        </div>
                        <div class="form-group changepassword-verify">
                            <label class="col-md-2 control-label">短信验证码</label>
                            <div class="col-md-6">
                                <input type="text" name="Form[code]" class="input rounded form-control changepassword-form-contro" validate="{required:true}" />&nbsp;&nbsp;
                                <input class="btn btn-default" id="sendCode" type="button" value="获取验证码">
                            </div>
                        </div>
                        <button class="col-md-2 col-md-offset-2 btn btn-primary changepassword-xz" type="submit">下一步</button>
                    </div>
                </form>
            </div>
        </div>

        </div>
</div>
<?php $this->load->module('index/index/foot');?>